package net.sudot.chess.business.model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

/**
 * 订单日志
 *
 * @author tangjialin on 2018-03-22.
 */
@Getter
@Setter
@Accessors(chain = true)
@Entity
public class OrderLog extends BaseEntity<OrderLog> {

    /** 类型 */
    public enum Type {
        CREATE("订单创建"),
        PAYMENT("订单收款"),
        COMPLETE("订单完成"),
        CANCEL("订单取消"),
        REFUNDS("订单退款");
        private String memo;

        Type(String memo) {
            this.memo = memo;
        }

        public String memo() {
            return memo;
        }
    }

    /** 订单 */
    private Long orderId;
    /** 类型 */
    @Enumerated(EnumType.STRING)
    private OrderLog.Type type;
    /** 详情 */
    private String memo;

}